package cn.me.alphamq.broker.model.timewheel;

import cn.me.alphamq.broker.enumeration.SlotMsgTypeEnum;

/**
 * 时间轮的槽位的模型
 *
 * @author f
 */
public class TimeWheelSlotModel {

    /**
     * 位于该槽位上的消息
     */
    private Object msg;

    /**
     * 消息的类型
     *
     * @see SlotMsgTypeEnum
     */
    private int msgType;

    /**
     * 剩余时间，用于处理 N min M sec 这种类型的延迟时间
     * 当过了 N min 之后，将这个消息放到 sec 的时间轮中，延迟时间位 M sec
     */
    private int remainTime;

    /**
     * 处理时间
     */
    private long executeTime;

    public TimeWheelSlotModel() {
    }

    public TimeWheelSlotModel(Object msg, int msgType, long executeTime) {
        this(msg, msgType, executeTime, 0);
    }

    public TimeWheelSlotModel(Object msg, int msgType, long executeTime, int remainTime) {
        this.msg = msg;
        this.msgType = msgType;
        this.remainTime = remainTime;
        this.executeTime = executeTime;
    }

    public Object getMsg() {
        return msg;
    }

    public void setMsg(Object msg) {
        this.msg = msg;
    }

    public int getMsgType() {
        return msgType;
    }

    public void setMsgType(int msgType) {
        this.msgType = msgType;
    }

    public int getRemainTime() {
        return remainTime;
    }

    public void setRemainTime(int remainTime) {
        this.remainTime = remainTime;
    }

    public long getExecuteTime() {
        return executeTime;
    }

    public void setExecuteTime(long executeTime) {
        this.executeTime = executeTime;
    }
}
